
package gov.chinatax.ctcps.generator.form;

import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for xtglYsxm.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="xtglYsxmForm"
 */
public class XtglYsxmForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _ysxmbh = null;
   private java.lang.String _nd = null;
   private java.lang.String _xmbm = null;
   private java.lang.String _xmmc = null;
   private java.lang.String _yzjdBz = null;
   private java.lang.String _sjbm = null;
   private java.lang.String _gsxmBz = null;
   private java.lang.String _jjxmBz = null;
   private java.lang.String _xmztBz = null;
   private java.lang.String _zt1 = null;
   private java.lang.String _zt2 = null;

   /**
    * Standard constructor.
    */
   public XtglYsxmForm() {
   }

   /**
    * Returns the ysxmbh
    *
    * @return the ysxmbh
    */
   public java.lang.String getYsxmbh() {
      return _ysxmbh;
   }

   /**
    * Sets the ysxmbh
    *
    * @param ysxmbh the new ysxmbh value
    */
   public void setYsxmbh(java.lang.String ysxmbh) {
      _ysxmbh = ysxmbh;
   }
   /**
    * Returns the nd
    *
    * @return the nd
    */
   public java.lang.String getNd() {
      return _nd;
   }

   /**
    * Sets the nd
    *
    * @param nd the new nd value
    */
   public void setNd(java.lang.String nd) {
      _nd = nd;
   }
   /**
    * Returns the xmbm
    *
    * @return the xmbm
    */
   public java.lang.String getXmbm() {
      return _xmbm;
   }

   /**
    * Sets the xmbm
    *
    * @param xmbm the new xmbm value
    */
   public void setXmbm(java.lang.String xmbm) {
      _xmbm = xmbm;
   }
   /**
    * Returns the xmmc
    *
    * @return the xmmc
    */
   public java.lang.String getXmmc() {
      return _xmmc;
   }

   /**
    * Sets the xmmc
    *
    * @param xmmc the new xmmc value
    */
   public void setXmmc(java.lang.String xmmc) {
      _xmmc = xmmc;
   }
   /**
    * Returns the yzjdBz
    *
    * @return the yzjdBz
    */
   public java.lang.String getYzjdBz() {
      return _yzjdBz;
   }

   /**
    * Sets the yzjdBz
    *
    * @param yzjdBz the new yzjdBz value
    */
   public void setYzjdBz(java.lang.String yzjdBz) {
      _yzjdBz = yzjdBz;
   }
   /**
    * Returns the sjbm
    *
    * @return the sjbm
    */
   public java.lang.String getSjbm() {
      return _sjbm;
   }

   /**
    * Sets the sjbm
    *
    * @param sjbm the new sjbm value
    */
   public void setSjbm(java.lang.String sjbm) {
      _sjbm = sjbm;
   }
   /**
    * Returns the gsxmBz
    *
    * @return the gsxmBz
    */
   public java.lang.String getGsxmBz() {
      return _gsxmBz;
   }

   /**
    * Sets the gsxmBz
    *
    * @param gsxmBz the new gsxmBz value
    */
   public void setGsxmBz(java.lang.String gsxmBz) {
      _gsxmBz = gsxmBz;
   }
   /**
    * Returns the jjxmBz
    *
    * @return the jjxmBz
    */
   public java.lang.String getJjxmBz() {
      return _jjxmBz;
   }

   /**
    * Sets the jjxmBz
    *
    * @param jjxmBz the new jjxmBz value
    */
   public void setJjxmBz(java.lang.String jjxmBz) {
      _jjxmBz = jjxmBz;
   }
   /**
    * Returns the xmztBz
    *
    * @return the xmztBz
    */
   public java.lang.String getXmztBz() {
      return _xmztBz;
   }

   /**
    * Sets the xmztBz
    *
    * @param xmztBz the new xmztBz value
    */
   public void setXmztBz(java.lang.String xmztBz) {
      _xmztBz = xmztBz;
   }
   /**
    * Returns the zt1
    *
    * @return the zt1
    */
   public java.lang.String getZt1() {
      return _zt1;
   }

   /**
    * Sets the zt1
    *
    * @param zt1 the new zt1 value
    */
   public void setZt1(java.lang.String zt1) {
      _zt1 = zt1;
   }
   /**
    * Returns the zt2
    *
    * @return the zt2
    */
   public java.lang.String getZt2() {
      return _zt2;
   }

   /**
    * Sets the zt2
    *
    * @param zt2 the new zt2 value
    */
   public void setZt2(java.lang.String zt2) {
      _zt2 = zt2;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getYsxmbh() == null) {
         errors.add("ysxmbh", new ActionError("error.ysxmbh.required"));
      }
      if(getNd() == null) {
         errors.add("nd", new ActionError("error.nd.required"));
      }
      if(getXmbm() == null) {
         errors.add("xmbm", new ActionError("error.xmbm.required"));
      }
      if(getGsxmBz() == null) {
         errors.add("gsxmBz", new ActionError("error.gsxmBz.required"));
      }
      if(getJjxmBz() == null) {
         errors.add("jjxmBz", new ActionError("error.jjxmBz.required"));
      }
      if(getXmztBz() == null) {
         errors.add("xmztBz", new ActionError("error.xmztBz.required"));
      }
      // TODO test format/data
      return errors;
   }
}
